using System;

namespace CommandBuilder
{
	public class Work
	{
		public static Work _default = new Work();

		TcpCommand command;

		public bool IsConnected {
			get{ return command.IsConnected;}
		}

		protected Work ()
		{
			command = new TcpCommand();
		}

		public void Connect(string ip, int port)
		{
			command.Connect(ip, port);
		}

		public void Send (string content)
		{
			if (command != null && command.IsConnected) 
			{
				command.SendMessage(content);
			}
		}

		public void Close ()
		{
			if (command.IsConnected) {
				command.Close();
			}
		}

		//todo:反馈
	}
}

